/*
 * ConexionDB.java
 *
 * Created on March 13, 2007, 2:22 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package wasolicitudesfiec.consultas;

import java.net.SocketException;
import java.sql.*;



/**
 *
 * @author kabad
 */
public class ConexionDB {
    /** Creates a new instance of ConexionDB */
    public ConexionDB() {
    }
    public Connection openConexion() {
		Connection con=null;
        try {
            Class.forName("com.mysql.jdbc.Driver");
            if (con!=null && !con.isClosed()) {
                con.close();
            }
//            con = DriverManager.getConnection("jdbc:mysql://192.168.31.2:3306/dbsofiec","root","sql");
           con = DriverManager.getConnection("jdbc:mysql://localhost:3306/dbsofiec","root","sql");

//            con = DriverManager.getConnection("jdbc:mysql://200.10.150.90:3306/dbvehiculos","root","h8bmbfar");
          return con;
        } catch (Exception ex) {
            ex.printStackTrace();
            if (ex instanceof SocketException) {
                SocketException se=(SocketException)ex;
            }
        }
        return null;
    }
    
}
